package com.example.maoyanmovie.ui.activity;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.example.maoyanmovie.databinding.ActivityCinemaDetailBinding;
import com.example.maoyanmovie.utils.Constants;

public class CinemaDetailActivity extends AppCompatActivity {

    private ActivityCinemaDetailBinding binding;
    private int cinemaId;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityCinemaDetailBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        cinemaId = getIntent().getIntExtra(Constants.INTENT_KEY_CINEMA_ID, 0);

        initView();
        loadCinemaDetail();
    }

    private void initView() {
        binding.ivBack.setOnClickListener(v -> finish());
    }

    private void loadCinemaDetail() {
        // 模拟数据
        binding.tvName.setText("万达影城");
        binding.tvAddress.setText("地址：北京市朝阳区建国路93号万达广场");
        binding.tvPhone.setText("电话：010-59056888");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        binding = null;
    }
}
